package com.example.spring_test2.controller;

import com.example.spring_test2.dao.orderDao;
import com.example.spring_test2.domain.Order;
import com.example.spring_test2.service.orderService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class orderController {

    @Autowired
    orderService orderservice;

    @PostMapping("/addOrder")
    public void addOrder(@RequestBody Order order){
        orderservice.addOrder(order);
    }

    @PostMapping("/updateOrder")
    public void updateOrder(long id, String description){
        orderservice.updateOrder(description,id);
    }

}
